package com.dk.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dk.entity.DtLabel;
import com.dk.mapper.DtLabelMapper;
import com.dk.service.IDtLabelService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author author
 * @since 2021-12-22
 */
@Service
public class DtLabelServiceImpl  implements IDtLabelService {
    @Autowired
    private DtLabelMapper dtLabelMapper;

    @Override
    public IPage<DtLabel> selectList(Integer pageNum, Integer pageSize) {
        Page<DtLabel> page = new Page<>(pageNum, pageSize);
        return dtLabelMapper.selectPage(page, null);
    }

    @Override
    public void insertLable(DtLabel dtLabel) {
        dtLabelMapper.insert(dtLabel);
    }

    @Override
    public void updatgeLable(DtLabel label) {
        dtLabelMapper.updateById(label);
    }

    @Override
    public DtLabel selectLableById(Long id) {
        return dtLabelMapper.selectById(id);
    }

    @Override
    public void deleteById(Long id) {
        dtLabelMapper.deleteById(id);
    }
}
